package org.power.core.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

/**
 * @author 苗冬冬
 */
public class SocketClient {

    /*public static void main(String[] args) throws IOException {
        try {
            String host = "192.168.3.69";
            String host1 = "127.0.0.1";
            Socket socket = new Socket(host, 52000);
            System.out.println("客户端启动成功");
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            PrintWriter write = new PrintWriter(socket.getOutputStream());
            BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            String readline;
            System.out.println("请输入:");
            readline = br.readLine();
            System.out.println("客户:" + readline);
            String reData;
            while (!readline.equals("end")) {

                write.println(readline);
                write.flush();
                System.out.println("服务返回:");
                if ((reData = in.readLine()) != null) {
                    System.out.println(reData);
                    //System.out.println(12);
                }
                System.out.println("再一次输入:");
                readline = br.readLine();
                System.out.println("客户:" + readline);
            }
            write.close();
            in.close();
            socket.close();
        } catch (Exception e) {
            System.out.println("can not listen to:" + e);
        }
    }*/

}
